/*5mA2bafpNiN+GgLypv6X4JnJdASY9LeuV1hPn7KPAIOgdQTC2VbgvSy7lyHxmxgr*/
/*
 * @Descripttion:
 * @version:
 * @Author: Chendch
 * @Date: 2020-10-10 17:36:07
 * @LastEditors: Chendch
 * @LastEditTime: 2021-04-09 14:05:15
 */
/**
 * @desc 判断对象是否为空
 * @param {Object} obj
 * @return {Boolean}
 */
export const isEmptyObj = (obj = {}) => {
    return Object.keys(obj).length ? false : true
}

/**
 * @desc 判断数组是否为空
 * @param {Array} arr
 * @return {Boolean}
 */
export const isEmptyArr = (arr = []) => {
    return arr.length ? false : true
}

/**
 * @desc 判断对象是否为空
 * @param {Object} obj
 * @return {Boolean}
 */
 export const isEmpty = (param = null) => {
    let paramType = Object.prototype.toString.call(param).slice(8, -1).toLowerCase(),
        isEmpty = false;
    switch(paramType) {
        case "undefined":
        case "null":
            isEmpty = true;
            break;
        case "string":
        case "number":
        case "array":
            isEmpty = !param.length;
            break;
        case "object":
            isEmpty = !Object.keys(param).length;
            break;
        case "set":
            isEmpty = !param.size;
            break;
        case "map":
            isEmpty = !param.keys().length;
            break;
        case "symbol":
            isEmpty = String(param).length == 8;
            break;
    }
    return isEmpty;
}










/*5mA2bafpNiN+GgLypv6X4JnJdASY9LeuV1hPn7KPAIOgdQTC2VbgvSy7lyHxmxgr*/
